<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Blog-编辑页</title>
    <link rel="stylesheet" href="./CSS/common.css">
    <link rel="stylesheet" href="./CSS/blog_edit.css">
    <!-- 引入 editor.md 的依赖 -->
    <link rel="stylesheet" href="editor.md/css/editormd.min.css" />
    <script src="JS/jquery.min.js"></script>
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
    <script src="./JS/login.js"></script>

</head>
<body>
      <!--导航栏-->
      <div class="nav">
        <img src="image/logo.jpg" alt="">
        <span class="title">我的博客系统</span>
        <!--留白占位-->
        <span class="spacer"></span>
        <!--这是按钮-->
        <a href="blog_list.html">主页</a>
        <a href="blog_edit.html">写博客</a>
        <a href="logout" onclick="alert('注销成功')">注销</a>
    </div> 

    <!--编辑内容-->
    <form action="blog" method="post" class="form">
    <div class="edit-container">
            <div class="title">
                <input type="text" name="title" id="title" placeholder="不断创作才不会被茫茫人海淹没">
                <input type="submit" value="发布文章" id="submit">
            </div>
            <div class="editor" id="editor">
                <textarea name="content" style="display: none;"></textarea>
            </div>
            <!--引入编辑器-->
    </div>
    </form>

    <script>
        //检验登录状态
        checkLogin();
        // 初始化编辑器
        var editor = editormd("editor", {
            // 这里的尺寸必须在这里设置. 设置样式会被 editormd 自动覆盖掉. 
            width: "100%",
            // 设定编辑器高度
            height: "calc(100% - 50px)",
            // 编辑器中的初始内容
            markdown: "# 在这里写下一篇Blog",
            // 指定 editor.md 依赖的插件路径
            path: "editor.md/lib/",
            saveHTMLToTextArea:true
        });
    </script>
</body>
</html>